<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script>
		let str = "aaadfsafasjlkfjsaldjfsadfasdfsjhd";
		let obj = str.split("").reduce((a, b) => {
			if (b in a) {
				a[b]++;

			} else {
				a[b] = 1;
			}

			return a;
		}, {});

		let max = 0;
		let result = {};

		for (let i in obj) {
			if (obj[i] > max) {
				max = obj[i];
				result = {
					key: i,
					value: obj[i]
				}
			}
		}

		console.log(result);
	</script>
</body>
</html>